import type { Http } from '@/utils/http'

export default class CompanyApi {

    protected request: Http

    constructor(request: Http) {
        this.request = request
    }

    queryCompanyPage<T>(args: { name?: string, pageNum?: number, pageSize?: number }) {
        return this.request.get('manager/company', args)
    }

    insertCompany<T>(args: {}): Promise<any[]> {
        return this.request.postJson('manager/company/insert', args)
    }

    updateCompany<T>(args: {}): Promise<any[]> {
        return this.request.postJson('manager/company/update', args)
    }

    updateCompanyStatus<T>(args: {}): Promise<any[]> {
        return this.request.postForm('manager/company/updateStatus', args)
    }

    deleteCompany<T>(args: {}): Promise<any[]> {
        return this.request.postForm('manager/company/delete', args)
    }

    queryCompanyUserPage<T>(args: {}): Promise<any[]> {
        return this.request.get('manager/companyUser', args)
    }

    insertCompanyUser<T>(args: {}): Promise<any[]> {
        return this.request.postJson('manager/companyUser/insert', args)
    }

    updateCompanyUser<T>(args: {}): Promise<any[]> {
        return this.request.postJson('manager/companyUser/update', args)
    }

    deleteCompanyUser<T>(args: {}): Promise<any[]> {
        return this.request.postForm('manager/companyUser/delete', args)
    }

}

